/**
 * cone-service: send.js
 * Description: 摘要说明
 * 
 * 
 * Time: 2021/11/5 20:46
 */

module.exports = async(ctx, next)=>{
    /**
     * 挂载api数据相应函数
     * @param status
     * @param type
     * @param data
     */
    ctx.send = ({ status = 200, type = 'json', data = null } = {}) => {
        ctx.response.status = status;
        ctx.response.type = type;
        ctx.response.body = data;
    }

    await next()
}